package com.gitee.openviducn.inspector.auth;


import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * 登录角色拦截注解
 * @Author: https://gitee.com/wesleyOne
 * @Date: 03.02 2020
 * 参考[https://github.com/alibaba/Sentinel/]控制台项目
 */
@Target({ElementType.METHOD, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
public @interface AuthAction {

    /**
     * 是否要求角色
     * @return  角色数组
     */
    AuthService.SystemRole[] roles() default {};

    /**
     * @return the target name to control
     */
    String targetName() default "app";

    /**
     * @return the message when permission is denied
     */
    String message() default "Permission denied";
}
